/*
 * RentStrutsActionForm.java
 *
 * Created on April 26, 2007, 12:08 PM
 */

package com.abbh.libcommunity.struts.beans;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author Abdul Khader J Syed
 * @version
 */

public class RentStrutsActionForm extends org.apache.struts.action.ActionForm {
    private Integer userId;
    private Integer itemId;
    
    
    public RentStrutsActionForm() {
        super();
        // TODO Auto-generated constructor stub
    }
    
    
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getItemId() {
        return itemId;
    }

    public void setItemId(Integer itemId) {
        this.itemId = itemId;
    }
    
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        if (getUserId() == null ) {
            errors.add("userId", new ActionMessage("error.UserId.required"));
            // TODO: add 'error.name.required' key to your resources
        }
        
        if (getItemId() == null ) {
            errors.add("itemId", new ActionMessage("error.ItemId.required"));
            // TODO: add 'error.name.required' key to your resources
        }
        return errors;
    }

}
